//
//  BLTimeAxisAppearance.h
//  BLTimeAxis
//
//  Created by dg on 2025/4/18.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

static NSString *const KBLAppearanceUpdateNotificationName = @"KBLAppearanceUpdateNotificationName";

typedef NS_ENUM(NSUInteger, BLAxisDirection) {
    BLAxisDirectionHorizontal,  // 水平
    BLAxisDirectionVertical,    // 垂直
};

typedef NS_ENUM(NSUInteger, BLStrokeLocationType) {
    BLStrokeLocationTypeFlexible,   // 自行设置的值生效
    BLStrokeLocationTypeMiddle,     // 中间位置
    BLStrokeLocationTypeMinimum,    // 最小位置，一般是对应为0.0的位置
    BLStrokeLocationTypeMaximum,    // 最大位置
};
typedef NS_ENUM(NSUInteger, BLStrokeSizeType) {
    BLStrokeSizeTypeFlexible,   // 自行设置的值生效
    BLStrokeSizeTypeFull,       // 全部
    BLStrokeSizeTypeHalf,       // 一半
};

// 外观管理器
@interface BLTimeAxisAppearance : NSObject

+ (instancetype)sharedAppearance;

// 渲染Class，必须是BLTimeAxisRenderer子类
@property(nonatomic, assign) Class rendererClass;

// 方向
@property(nonatomic, assign) BLAxisDirection direction;
// 主背景色，即对BLTimeAxisView的backgroundColor的设置
@property(nonatomic, strong) UIColor *mainBackgroundColor;

#pragma mark - 背景色设置，对应的BLTimeAxisBackground模型的设置
@property(nonatomic, strong) UIColor *backgroundColor;
@property(nonatomic, assign) CGFloat backgroundStrokeSize;
@property(nonatomic, assign) BLStrokeSizeType backgroundStrokeSizeType;

#pragma mark - 刻度尺设置，对应BLTimeAxisRule模型的设置
@property(nonatomic, strong) UIColor *ruleColor;
@property(nonatomic, assign) CGFloat ruleStrokeSize;
@property(nonatomic, assign) CGFloat ruleFixedOffset;
@property(nonatomic, assign) BLStrokeLocationType ruleOffsetLocationType;

#pragma mark - 数字、分割线的设置，对应BLTimeAxisDigitalDivision模型的设置
@property (nonatomic, strong) UIColor *divisionColor;
@property (nonatomic, assign) CGFloat divisionStrokeSize;
@property (nonatomic, strong) NSDictionary *digitalAttribute;
@property (nonatomic, assign) CGFloat minimumScale;
@property (nonatomic, assign) CGFloat maximumScale;
@property (nonatomic, assign) CGFloat oneToOneScaleMatchMaxHoursInVisible;

#pragma mark - 基线的设置，对应BLTimeAxisBaseLine模型的设置
@property (nonatomic, strong) UIColor *baseLineColor;
@property (nonatomic, assign) CGFloat baseLineStrokeSize;
@property (nonatomic, assign) CGFloat baseLineFixedOffset;
@property (nonatomic, assign) BLStrokeLocationType baseLineOffsetLocationType;

#pragma mark - 数据段的设置，对应BLTimeAxisData模型的设置
@property (nonatomic, strong) UIColor *dataStrokeColor;
@property (nonatomic, assign) CGFloat dataStrokeSize;
@property (nonatomic, assign) BLStrokeSizeType dataStrokeSizeType;

/// 手动更新
- (void)updateAppearance;

@end

NS_ASSUME_NONNULL_END
